import java.io.File;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        File f = new File("./test.txt");
        f.createNewFile();
        System.out.println(f.exists());
        //是否为文件
        System.out.println(f.isFile());
        //是否为文件夹
        System.out.println(f.isDirectory());
    }
}
